package com.china08.yxyapi.api.manage.sch.platform.attendance.setting;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.china08.yxyapi.api.YxyApiBaseController;
import com.china08.yxyapi.model.YxyApiRespModel;
import com.china08.yxyapi.util.ClientIPUtil;

import io.swagger.annotations.ApiOperation;

@CrossOrigin
@RestController
public class AttendAnceSettingIPController extends YxyApiBaseController {

    @ApiOperation("设置考勤配置")
    @RequestMapping(value = "/api_yw/manage/sch/platform/attendance/statistics/ip", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public RespModel precess(HttpServletRequest request, HttpServletResponse response) {
        String ip = ClientIPUtil.getRealClientIP(request);

        RespModel respModel = new RespModel();
        respModel.ip = ip;
        return respModel;
    }

    protected static class RespModel extends YxyApiRespModel {
        public String ip;
    }
}
